package mutsumimod.cards.stand.specialstand;

import com.badlogic.gdx.graphics.Color;
import com.megacrit.cardcrawl.actions.common.ApplyPowerAction;
import com.megacrit.cardcrawl.cards.AbstractCard;
import com.megacrit.cardcrawl.characters.AbstractPlayer;
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.monsters.AbstractMonster;
import mutsumimod.actions.TriggerStandAction;
import mutsumimod.cards.BaseCard;
import mutsumimod.character.Mutsumi;
import mutsumimod.powers.BlindPower;
import mutsumimod.powers.PerfectPower;
import mutsumimod.powers.StandPower;
import mutsumimod.util.CardStats;

public class Perfect extends BaseCard {
    public static final String ID = makeID(Perfect.class.getSimpleName());
    public static final CardStats info = new CardStats(
            Mutsumi.Meta.CARD_COLOR,
            CardType.ATTACK,
            CardRarity.UNCOMMON,
            CardTarget.ENEMY,
            1
    );

    public Perfect() {
        super(ID, info);
        setAttr(12,0,1);
        setAttrUpg(4,0,0);
    }

    @Override
    public void triggerOnGlowCheck() {
        int amount=0;
        if(AbstractDungeon.player.hasPower(StandPower.POWER_ID)){
            amount=AbstractDungeon.player.getPower(StandPower.POWER_ID).amount;
        }
        if(amount==5||AbstractDungeon.player.hasPower(BlindPower.POWER_ID)){
            glowColor= Color.GOLD.cpy();
        }else{
            super.triggerOnGlowCheck();
        }
    }

    @Override
    public void use(AbstractPlayer p, AbstractMonster m) {
        addToBot(new TriggerStandAction(p,5,new ApplyPowerAction(m,p,new PerfectPower(m)),true));
        damageMonster(m);
    }


    @Override
    public AbstractCard makeCopy() {
        return new Perfect();
    }
}
